﻿<%@ Page Title="" Language="C#" MasterPageFile="~/pages/Site.Master" AutoEventWireup="true"
    CodeBehind="PropagateRecord.aspx.cs" Inherits="OnlineManagement.Web.pages.PropagateRecord" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../resources/css/jquery.ui.all.css" rel="stylesheet" type="text/css" />
    <script src="../resources/scripts/jquery.ui.core.js" type="text/javascript"></script>
    <script src="../resources/scripts/jquery.ui.datepicker.js" type="text/javascript"></script>
    <script src="../resources/scripts/jquery.ui.widget.js" type="text/javascript"></script>
    <script src="../resources/scripts/jquery.ui.datepicker-zh-TW.js" type="text/javascript"></script>
    <script src="../resources/scripts/myAjax.js" type="text/javascript"></script>
    <script src="../resources/scripts/facebox.js" type="text/javascript"></script>
    <script src="../resources/scripts/jquery.cookie.js" type="text/javascript"></script>
    <script type="text/javascript" language="javascript">
        $(document).ready(function () {
            $("#txtPropagateDate").datepicker($.datepicker.regional["zh-TW"]).datepicker("option", "dateFormat", "yy-mm-dd");

            $("#btnSave").click(function () {
                var hoggeryId = 1001;
                var sowId = $("#<%=ddlSowId.ClientID %>").val();
                var propagateDate = $("#txtPropagateDate").val();
                var liveCount = $("#txtLiveCount").val();
                var maleCount = $("#txtMaleCount").val();
                var femaleCount = $("#txtFemaleCount").val();
                var weakCount = $("#txtWeakCount").val();
                var malformationCount = $("#txtMalformationCount").val();
                var deathCount = $("#txtDeathCount").val();
                if (liveCount =="") {
                    liveCount = 0;
                }
                $.ajax2({
                    type: "post",
                    contentType: "application/json",
                    url: "../WebServices/PropagateService.asmx/SowPropagate",
                    dataType: "json",
                    data: "{ hoggeryId: '" + hoggeryId + "',sowIdStr:'" + sowId + "',propagateDateStr:'" + propagateDate + "',liveCount:'" + liveCount
                    + "',deathCount:'" + deathCount + "',malformationCount:'" + malformationCount + "',weakCount:'" + weakCount
                    + "',maleCount:'" + maleCount + "',femaleCount:'" + femaleCount + "' }",
                    success: function (data) {
                        if (data.d.Flag) {
                            $("#msg > div").remove();
                            var span = "<div class='notification success png_bg'> <a href='#' class='close'><img src='../resources/images/icons/cross_grey_small.png' title='关闭' alt='关闭' /></a><div>" + data.d.Message + "</div></div>";
                            $("#msg").append(span);
                        } else {
                            $("#msg > div").remove();
                            var span = "<div class='notification attention png_bg'> <a href='#' class='close'><img src='../resources/images/icons/cross_grey_small.png' title='关闭' alt='关闭' /></a><div>" + data.d.Message + "</div></div>";
                            $("#msg").append(span);
                        }
                    },
                    error: function (error) {
                        $("#msg > div").remove();
                        var span = "<div class='notification error png_bg'> <a href='#' class='close'><img src='../resources/images/icons/cross_grey_small.png' title='关闭' alt='关闭' /></a><div>提交失败：" + error.status + "</div></div>";
                        $("#msg").append(span);
                    }
                });

            });

        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="content-box-header">
        <h3>
            母猪繁殖管理</h3>
        <div class="clear">
        </div>
    </div>
    <div class="content-box-content">
    <div class="notification attention png_bg"> <a href="#" class="close"><img src="../resources/images/icons/cross_grey_small.png" title="Close this notification" alt="close" /></a>
            <div> 红色星号 <span style=" color:Red">*</span>为必填项目 </div>
          </div>
        <fieldset>
            <p>
                <span>
                    母猪耳号:</span>
                <asp:DropDownList runat="server" ID="ddlSowId">
                </asp:DropDownList>
                <!--        <input class="text-input small-input" type="text" id="small-input" name="small-input" />-->
                <%-- <span class="input-notification success png_bg">Successful message</span>--%>
                <!-- Classes for input-notification: success, error, information, attention -->
                <br />
            </p>
            <p>
                <span>
                    繁殖时间：
                </span>
                 <input id="txtPropagateDate" type="text" class="text-input small-input"  />
            </p>
            <p>
                <span>
                    存活数量：</span>
                <input id="txtLiveCount" class="text-input small-input"  onkeyup="JavaScript:this.value=this.value.replace(/\D/gi,'')" />
                <small>请输入数字,不填即为0</small>
            </p>
            <p>
                <span>
                    公仔数量：</span>
                <input id="txtMaleCount" class="text-input small-input" value="0" onkeyup="JavaScript:this.value=this.value.replace(/\D/gi,'')" />
                <small>请输入数字,不填即为0</small>
            </p>
            <p>
                <span>
                    母仔数量：</span>
                <input id="txtFemaleCount" class="text-input small-input" value="0" onkeyup="JavaScript:this.value=this.value.replace(/\D/gi,'')" />
                <small>请输入数字,不填即为0</small>
            </p>
            <p>
                <span>
                    弱仔数量：</span>
                <input id="txtWeakCount" class="text-input small-input" value="0" onkeyup="JavaScript:this.value=this.value.replace(/\D/gi,'')" />
                <small>请输入数字，不填即为0</small>
            </p>
            <p>
                <span>
                    畸形数量：</span>
                <input id="txtMalformationCount" class="text-input small-input" value="0" onkeyup="JavaScript:this.value=this.value.replace(/\D/gi,'')" />
                <small>请输入数字，不填即为0</small>
            </p>
            <p>
                <span>
                    损失数量：</span>
                <input id="txtDeathCount" class="text-input small-input" value="0" onkeyup="JavaScript:this.value=this.value.replace(/\D/gi,'')" />
                <small>请输入数字，不填即为0</small>
            </p>
           <%-- <p>
                <span>
                    备注说明</span>
                <asp:TextBox ID="txtComment" runat="server" TextMode="MultiLine"></asp:TextBox>
            </p>--%>
            <p>
                <input id="btnSave" class="confirm-button" value="保存" type="button" onclick="save();" />
                <input id="btnCancel" class="confirm-button" value="取消" type="button" />
            </p>
            <p></p>
            <p></p>
            <p>
                <div id="msg">
                </div>
            </p>
        </fieldset>
    <div class="clear">
    </div>
    </div>
    
    <!-- End .clear -->
</asp:Content>
